from core.basehandler import BaseHandler
from core.room import Room  
from core.action import Action

class Sea4SharkDeath(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # add inventory items
        
        # build list of actions
        self.add_action(ScreamDeath)
        self.add_action(NobleDeath)
        self.add_action(EmbarrassingDeath)

    
    # return description of room.
    def get_description(self):
        return "You swim out for the food with the knife in hand.  Feeling no fear you stab at the sharks' eyes as he swims pass.  After-all, you are human, ruler of the earth, top of the food chain, earth's greatest killer, he is nothing!!! Unfortunately, that's a shark and you just enraged her with you wimpy knife jabs.  The last thing you see is the sharks' razor sharp teeth as you're swallowed whole."
    
    # return image of room
    def get_image(self):
        return 'sea4sharkdeath_pic.jpg'


class Sea4SharkDeathHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return Sea4SharkDeath

# define actions for this room

class NobleDeath(Action):
    def __init__(self):
        Action.__init__(self, "NobleDeath")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Die a noble death"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'sea11finaldeath'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
    def do_action(self,game,room,request):
        room.inventory.clear()
        player = game.get_player()
        player.inventory.clear()
        
class ScreamDeath(Action):
    def __init__(self):
        Action.__init__(self, "ScreamDeath")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Screeeeaaammmm!!!!!"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'sea11finaldeath'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
    def do_action(self,game,room,request):
        room.inventory.clear()
        player = game.get_player()
        player.inventory.clear()
    
class EmbarrassingDeath(Action):
    def __init__(self):
        Action.__init__(self, "EmbarrassingDeath")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Cry a lot and die embarrassed"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'sea11finaldeath'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"

    def do_action(self,game,room,request):
        room.inventory.clear()
        player = game.get_player()
        player.inventory.clear()
    